# !/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author:zzly
@file:views.py
@time:2020/09/08
"""

from rest_framework import generics
from apps.adorn_process.models import AdornProcess
from .serializers import AdornProcessAppSeializer, AdornProcessDetailAppSeializer
from utils import response_ok, response_error


class AdornProcessListView(generics.ListAPIView):
    queryset = AdornProcess.objects.filter()
    serializer_class = AdornProcessAppSeializer

    def get(self, request, *args, **kwargs):
        serializer = self.serializer_class(self.get_queryset(), many=True)
        return response_ok(serializer.data)

    def paginate_queryset(self, queryset):
        return None


class AdornProcessDetailView(generics.RetrieveAPIView):
    queryset = AdornProcess.objects.filter()
    serializer_class = AdornProcessDetailAppSeializer
